import React, {useLayoutEffect} from 'react';
// import Map from 'react-bmapgl/Map'
// import { Marker, NavigationControl, InfoWindow, MapTypeControl} from 'react-bmapgl';

const Com = () => {
    useLayoutEffect(() => {
        var map = new window.BMapGL.Map("container");          // 创建地图实例 
        var point = new window.BMapGL.Point(116.404, 39.915);  // 创建点坐标 
        map.centerAndZoom(point, 15);                 // 初始化地图，设置中心点坐标和地图级别
    }, [])
    return (
        <div>
            <h1>百度地图</h1>
            {/* <Map
                center={new window.BMapGL.Point(116.404449, 39.914889)}
                zoom={12}
                tilt={40}
                >
                <MapTypeControl />
            </Map> */}
            <div id="container" style={ { width: '100%', height: 600 } }></div>
        </div>
    )
}

export default Com